<!--
 * @Descripttion: 异步选择器
 * @version: 1.0
 * @Author: sakuya
 * @Date: 2021年8月3日15:53:37
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @LastEditTime: 2023-07-06 16:26:58
-->

<template>
	<skRadioBox
		v-model="value"
		:apiObj="url"
		:valueEqKey="valueEqKey"
		:params="params"
		type="width:100%"
	/>
</template>

<script>
import skRadioBox from "./../skRadioBox";

export default {
	emits: ["checked", "update:modelValue"],
	name: "skDicCheckBox",
	props: {
		code: { type: String, default: () => "" },
		valueEqKey: { type: Boolean, default: false },
		modelValue: null,
	},
	components: { skRadioBox },
	watch: {
		modelValue() {
			this.value = this.modelValue;
		},
		value() {
			this.$emit("checked", this.change);
			this.$emit("update:modelValue", this.value);
		},
		options() {
			this.valueChange();
		},
	},
	data() {
		return {
			url: this.$API.system.dic.getDicData,
			params: { code: this.code },
			value: this.modelValue,
		};
	},
	methods: {},
};
</script>
